﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using LuKou.Shopspace.Domains;
using LuKou.Member.Domains;
using LuKou.Web.BLL.Service;

namespace LuKou.Web.BLL.Extensions
{
    public static class GoodsAccessRecordExt
    {
        /// <summary>
        /// 获取用户信息
        /// </summary>
        /// <param name="user"></param>
        /// <returns></returns>
        public static User GetUser(this GoodsAccessRecord model)
        {
            return UserService.GetUserInfoById(model.UserID) ?? new User();
        }
        /// <summary>
        /// 获取用户的店铺
        /// </summary>
        /// <param name="user"></param>
        /// <returns></returns>
        public static Shop GetShop(this GoodsAccessRecord model)
        {
            return ShopService.GetShop(model.ShopID) ?? new Shop();
        }
        /// <summary>
        /// 获取商品信息
        /// </summary>
        /// <param name="user"></param>
        /// <returns></returns>
        public static Goods GetGood(this GoodsAccessRecord model)
        {
            return GoodsService.GetGoodsDetail(model.GoodsID) ?? new Goods();
        }
    }
}
